gtkwindow: Simplify GTK grab notification
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 17 May 2021 21:44:28 +0000 (23:44 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 17 May 2021 22:16:48 +0000 (00:16 +0200)
commitf003a4c6cc6f98c047571c5784712ba486dc17c6
tree954b876f7aa09bc945bc393ae5821d263b9a5eb2
parent8670034c86f8a36910a99bb794f98cf328de2b6c
gtkwindow: Simplify GTK grab notification

The _gtk_widget_grab_notify() function just (maybe) did a) reset
controllers and b) hide toplevels. The second part was a testing
remnant introduced in commit 024d832d943, not part of the original
fix.

Do the former more concisely, called from the place where we figure
out whether a widget's ability to receive events changed due to
GTK grabs. It's across those changes that we are interested in
resetting the controllers.

With the gestures being reset both ways, GtkWindowHandle (and
probably other) gestures are now able to reset after a GTK grab
takes input away (e.g. GtkMenuButton). This could be seen as
a sudden jump the next time they'd be dragged with the mouse,
as the gesture would "resume" the previous interaction.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3942
gtk/gtkwidget.c
gtk/gtkwidgetprivate.h
gtk/gtkwindow.c